public class Test1 {
    public static void main(String[] args) {
        System.out.println("所有的水仙花数：");
        for (int i = 100;; i++) {
            if (isNarcissistic(i)) {
                System.out.print(i + " ");
            }
        }
    }
    public static boolean isNarcissistic(int number) {
        int temp = number;
        int sum = 0;
        int digits = String.valueOf(number).length();
        while (number > 0) {
            int digit = number % 10;
            sum += Math.pow(digit, digits);
            number /= 10;
        }
        return sum == temp;
    }
}